<?php

namespace App\Admin\Extensions\Form\Config;

class Withdraw extends ConfigBase
{
    /**
     * The form title.
     *
     * @var string
     */
    public $title = '提现设置';
    public $incType = 'withdraw';

    /**
     * Build a form here.
     */
    public function form()
    {
        $this->text('store_withdraw_max', '商家提现上限(单笔)')->default(0.5)->rules('regex:/^\d+(.[0-9]{1,6})?$/', [
            'regex' => '格式错误',
        ]);
        $this->text('store_withdraw_min', '商家提现下限(单笔)')->default(0.5)->rules('regex:/^\d+(.[0-9]{1,6})?$/', [
            'regex' => '格式错误',
        ]);
        $this->number('store_withdraw_every', '每日提现次数')->min(1)->default(1);
        $this->text('store_withdraw_fee', '商家提现手续费(单笔)')->default(0.5)->rules('regex:/^\d+(.[0-9]{1,6})?$/', [
            'regex' => '格式错误',
        ])->help('每笔手续费');
        $this->divider();
        $this->text('user_withdraw_max', '用户提现上限(单笔)')->default(0.5)->rules('regex:/^\d+(.[0-9]{1,6})?$/', [
            'regex' => '格式错误',
        ]);
        $this->text('user_withdraw_min', '用户提现下限(单笔)')->default(0.5)->rules('regex:/^\d+(.[0-9]{1,6})?$/', [
            'regex' => '格式错误',
        ]);
        $this->number('user_withdraw_every', '每日提现次数')->min(1)->default(1);
        $this->text('user_withdraw_fee', '用户提现手续费(单笔)')->default(0.5)->rules('regex:/^\d+(.[0-9]{1,6})?$/', [
            'regex' => '格式错误',
        ])->help('每笔手续费');
        $this->disableReset();
    }
}
